<?php
include 'database.php'; //数据库的配置信息
require 'lianjie.php';  // 数据库的操作函数
$mac = $_GET['mac'];
$con = lianjieshujuku($servername, $name, $passwd);//连接数据库
if (!mysqli_select_db($con, 'flower')) {
    die("选择数据库失败");
}
$res = mysqli_query($con, "SELECT `kongshi`,`kongwen`,`jt`,`pt`,`macname` FROM `fname` WHERE `mac` = '$mac'");
$resarray = mysqli_fetch_array($res);

$returnpeizhi = array();
$returnpeizhi['kongshi'] = $resarray['kongshi'];
$returnpeizhi['kongwen'] = $resarray['kongwen'];
$returnpeizhi['jt'] = $resarray['jt'];
$returnpeizhi['pt'] = $resarray['pt'];
$returnpeizhi['macname'] = $resarray['macname'];


echo json_encode($returnpeizhi);